*&---------------------------------------------------------------------*
*& 包含               ZFIU019_PAI
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      Module  EXIT_COMMAND  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE EXIT_COMMAND INPUT.
  SAVE_OK = OK_CODE.
  CLEAR OK_CODE.
  CASE SAVE_OK.
    WHEN 'BACK' OR 'CANCEL'.
      IF GV_JSDDH IS INITIAL.
        LEAVE TO SCREEN 0.

      ELSE."其它程序跳转过来
        LEAVE PROGRAM.
      ENDIF.


    WHEN 'EXIT'.
      LEAVE PROGRAM.
    WHEN OTHERS.
  ENDCASE.

  IF ZFIT079_HEAD-JSDDH IS NOT INITIAL.
    PERFORM FRM_UNLOCK_JSDDH USING ZFIT079_HEAD-JSDDH.
  ENDIF.
ENDMODULE.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_9000  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_9000 INPUT.
  SAVE_OK = OK_CODE.
  CLEAR OK_CODE.

  "有操作时时检查录入数据
  IF SAVE_OK IS NOT INITIAL.

    IF GR_ALVGRID IS NOT INITIAL.
      GR_ALVGRID->CHECK_CHANGED_DATA( ).
      IF GV_ERROR IS NOT INITIAL.
        RETURN.
      ENDIF.
    ENDIF.

    IF GR_ALVGRID_NPO IS NOT INITIAL.
      GR_ALVGRID_NPO->CHECK_CHANGED_DATA( ).
      IF GV_ERROR IS NOT INITIAL.
        RETURN.
      ENDIF.
    ENDIF.

  ENDIF.

  CASE SAVE_OK.
    WHEN 'LB_JSDLX_SEL'. "发票结算单类型选择
      PERFORM FRM_GET_FPJSD_ITEM_DATA."重新获取发票结算单行项目数据

      IF ZFIT079_HEAD-JSDLX = GC_JSDLX_PO."基于PO

        GV_SUBSCREEN_9000 = '9001'.

      ELSE.  "无PO
        IF GT_ALV[] IS INITIAL.
          DO 10 TIMES.
            APPEND INITIAL LINE TO GT_ALV.
          ENDDO.
        ENDIF.
        GV_SUBSCREEN_9000 = '9009'.
      ENDIF.

**********************************************************************
    WHEN 'BTN_FP_CLEAR'.
      PERFORM FRM_CLR_INV_DATA.

    WHEN 'BTN_QUERY'.
      PERFORM FRM_DATA_QUERY.

    WHEN 'BTN_SELALL'. "全选
      PERFORM FRM_SELECT_ALL_OR_CLEAR USING 'X'.
      PERFORM FRM_CACULATE_ITEM.

    WHEN 'BTN_SELCLS'."取消全选
      PERFORM FRM_SELECT_ALL_OR_CLEAR USING SPACE.
      PERFORM FRM_CACULATE_ITEM.

    WHEN '&CHANGE'.
      IF ZFIT079_HEAD-JSDZT <> GC_JSDZT_DRAFT.
        MESSAGE TEXT-M04 TYPE 'E'.
        RETURN.
      ENDIF.

      IF SY-UNAME <> ZFIT079_HEAD-CRNAM.
        MESSAGE '您不是该单据创建人，不能修改'(M35) TYPE 'E'.
        RETURN.
      ENDIF.

      GV_MODE = GC_MODE_CHANGE.

      IF ZFIT079_HEAD-JSDLX = GC_JSDLX_NPO.
        IF GT_ALV[] IS INITIAL.
          DO 10 TIMES.
            APPEND INITIAL LINE TO GT_ALV.
          ENDDO.
        ENDIF.
      ENDIF.

      IF ZFIT079_HEAD-JSDDH IS NOT INITIAL.
        PERFORM FRM_LOCK_JSDDH USING ZFIT079_HEAD-JSDDH.
      ENDIF.

    WHEN '&DISPLAY'.
      GV_MODE = GC_MODE_DISPLAY.
      IF ZFIT079_HEAD-JSDDH IS NOT INITIAL.
        PERFORM FRM_UNLOCK_JSDDH USING ZFIT079_HEAD-JSDDH.
      ENDIF.

    WHEN '&SAVE'.
      DATA: LT_JSD_ITEM TYPE TT_ZFIT079_ITEM.

      PERFORM FRM_DATA_SAVE CHANGING LT_JSD_ITEM.

    WHEN '&SUBMIT'.
      PERFORM FRM_DATA_SUBMIT.

    WHEN '&VOID'.
      PERFORM FRM_DATA_VOID.

    WHEN '&SYNCFILE'.
      PERFORM FRM_SYNCFILE USING ZFIT079_HEAD SPACE.

    WHEN '&ATTACH'.
      PERFORM FRM_GOS_MANAGE.

**********************************************************************
    WHEN '9001_CL_FP'.
      GV_SUBSCREEN_9000 = '9002'.

    WHEN '9001_CL_CX'.
      GV_SUBSCREEN_9000 = '9005'.

    WHEN '9001_CL_ALV'.
      GV_SUBSCREEN_9000 = '9007'.


    WHEN '9002_EX_FP'.
      GV_SUBSCREEN_9000 = '9001'.

    WHEN '9002_CL_CX'.
      GV_SUBSCREEN_9000 = '9003'.

    WHEN '9002_CL_ALV'.
      GV_SUBSCREEN_9000 = '9008'.


    WHEN '9003_EX_FP'.
      GV_SUBSCREEN_9000 = '9005'.

    WHEN '9003_EX_CX'.
      GV_SUBSCREEN_9000 = '9002'.

    WHEN '9003_CL_ALV'.
      GV_SUBSCREEN_9000 = '9004'.


    WHEN '9004_EX_FP'.
      GV_SUBSCREEN_9000 = '9006'.

    WHEN '9004_EX_CX'.
      GV_SUBSCREEN_9000 = '9008'.

    WHEN '9004_EX_ALV'.
      GV_SUBSCREEN_9000 = '9003'.


    WHEN '9005_CL_FP'.
      GV_SUBSCREEN_9000 = '9003'.

    WHEN '9005_EX_CX'.
      GV_SUBSCREEN_9000 = '9001'.

    WHEN '9005_CL_ALV'.
      GV_SUBSCREEN_9000 = '9006'.


    WHEN '9006_CL_FP'.
      GV_SUBSCREEN_9000 = '9004'.

    WHEN '9006_EX_CX'.
      GV_SUBSCREEN_9000 = '9007'.

    WHEN '9006_EX_ALV'.
      GV_SUBSCREEN_9000 = '9005'.


    WHEN '9007_CL_FP'.
      GV_SUBSCREEN_9000 = '9008'.

    WHEN '9007_CL_CX'.
      GV_SUBSCREEN_9000 = '9006'.

    WHEN '9007_EX_ALV'.
      GV_SUBSCREEN_9000 = '9001'.


    WHEN '9008_EX_FP'.
      GV_SUBSCREEN_9000 = '9007'.

    WHEN '9008_CL_CX'.
      GV_SUBSCREEN_9000 = '9004'.

    WHEN '9008_EX_ALV'.
      GV_SUBSCREEN_9000 = '9002'.

    WHEN OTHERS.
  ENDCASE.

  CLEAR SAVE_OK.
ENDMODULE.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_8000  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_8000 INPUT.

  SAVE_OK = OK_CODE.
  CLEAR OK_CODE.
  CASE SAVE_OK.
    WHEN 'BTN_CONFIRM'.

      CASE 'X'.
        WHEN RD_GUONEI OR RD_GUOWAI OR RD_JISHOU.
          PERFORM FRM_INIT_SCREEN.

        WHEN RD_BATCH_GUONEI_PO.
          CALL TRANSACTION 'ZFIU021'.

        WHEN RD_REPORT_JSD.
          CALL TRANSACTION 'ZFIU020'.

        WHEN RD_REPORT_JSD_DETAIL.
          CALL TRANSACTION 'ZFIU025'.

        WHEN RD_REPORT_INV.
          CALL TRANSACTION 'ZFIU026'.
        WHEN OTHERS.
      ENDCASE.

    WHEN 'BTN_EXIT'.
      LEAVE PROGRAM.
  ENDCASE.
ENDMODULE.
*&---------------------------------------------------------------------*
*&      Module  MOD_ZFPHM_F4_VALUES  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE MOD_ZFPHM_F4_VALUES INPUT.
  PERFORM FRM_ZFPHM_F4_VALUES USING 'ZFIT079_HEAD-ZFPHM'.
ENDMODULE.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_8001  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_8001 INPUT.
  IF GV_JSDDH IS NOT INITIAL.
    PERFORM FRM_INIT_SCREEN.
  ENDIF.
ENDMODULE.
*&---------------------------------------------------------------------*
*&      Module  MOD_ZFPHM_CHANGE  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE MOD_ZFPHM_CHANGE INPUT.
  PERFORM FRM_GET_INV_DATA USING ZFIT079_HEAD-ZFPHM.
ENDMODULE.
*&---------------------------------------------------------------------*
*&      Module  MOD_LIFNR_CHANGE  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE MOD_LIFNR_CHANGE INPUT.
  PERFORM FRM_LIFNR_CHANGE.
ENDMODULE.
*&---------------------------------------------------------------------*
*&      Module  MOD_BUKRS_CHANGE  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE MOD_BUKRS_CHANGE INPUT.
  PERFORM FRM_BUKRS_CHANGE.
ENDMODULE.
